From 2ea338a8cf6e19bc8992a524cdcff6f2709c1c3c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Oct 2020 18:21:15 -0400 Subject: [PATCH] atspiroot: Don't leak references The reffing getter trap, lurking behind g_list_model_get_item(). --- gtk/a11y/gtkatspiroot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c index 3f64ebf82c..e8f7ef8817 100644 --- a/gtk/a11y/gtkatspiroot.c +++ b/gtk/a11y/gtkatspiroot.c @@ -281,6 +281,8 @@ handle_accessible_method (GDBusConnection *connection, { window = g_list_model_get_item (self->toplevels, i); + g_object_unref (window); + if (!gtk_widget_get_visible (window)) continue; @@ -335,6 +337,8 @@ handle_accessible_get_property (GDBusConnection *connection, if (gtk_widget_get_visible (window)) n_children += 1; + + g_object_unref (window); } res = g_variant_new_int32 (n_children); -- 2.30.2